/*

Stickman Adventure - a game created by Daco & his cousin

Copyright (C) 2011-2012  DacoTaco & Wouterke

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation version 2.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.


*/
#ifndef OBJECT_H
#define OBJECT_H

#include "Global.h"
#include "extern.h"
#include <vector>
#ifdef OGL_MODE
	#include "SDL.h"
	#include "SDL_opengl.h"
#endif

//amount of frames in sheet from left 2 right
#define SHEET_FRAMES 4
class Object
{
private:
	void initObject(const char* spritesheet,int xpos , int ypos,int h,int w,char typeObj);
protected:
	std::string sheet_name;
	SDL_Surface *sheet;
	char frame; 
	int x; int y;
	int height; int width;
	char type;
	SDL_Rect ColRect;
	SDL_Rect clip;
	vector<std::string> sound_names;
	vector< Mix_Chunk * >sounds;
#ifdef OGL_MODE
	GLuint texture;
#endif

public:
	Object(const char* spritesheet,int xpos , int ypos,int h,int w,char typeObj,const char* sound[],int soundlength);
	Object(const char* spritesheet,int xpos , int ypos,int h,int w,char typeObj);
	virtual void handle_events(SDL_Event e);
	virtual char Update(int collision,int y_ground, int x_wall);
	int getXPosition();
	int getYPosition();
	virtual SDL_Surface * getImage();
	virtual ~Object();
	virtual SDL_Rect* getImageClip();
	int getHeight();
	int getWidth();
	virtual SDL_Rect* GetColRect();
	char getType();
	virtual void CollisionAction(Object* o, int collision);
	virtual void draw(SDL_Surface* destination,Object* screen);
	virtual int GetVelocity(void);

};

#endif